﻿<%@ Page Language="VB" MasterPageFile="~/WebForm/Empty.master" AutoEventWireup="false" CodeFile="Stock.aspx.vb" Inherits="WebForm_ManageSalesForecast_Stock" title="Stock" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<script type="text/javascript">
//開啟Stock視窗
function OpenLinkWindow(sType)
{
    var SapCode = '<%=Me.OldCode %>';
    var url = '<%= ResolveUrl("~/WebForm/ManageSalesForecast/Stock.aspx") %>' + '?Sapcode=' + SapCode + '&SessionID=<%=Me.SessionID %>';
    window.open(url, '', OpenInCenter(450, 480) + ',left=0,top=0,toolbar=0,titlebar=0,location=center,resizable,scrollbars=Yes,status=1');
}

function OpenInCenter(width, height) {
    var left = (screen.width - width) / 2;
    var top = (screen.height - height) / 2;
    var params = 'width=' + width + ', height=' + height;
    params += ', top=' + top + ', left=' + left;
    return params;
}
</script>

    <div align="center">
            <table align="center">
                <tr>
                    <td align="center" colspan="2" height="20">
                        <asp:Label ID="PageTitle" SkinID="title" runat="server" meta:resourcekey="PageTitle"></asp:Label>
                    </td>
                </tr>
             </table>
            <asp:FormView ID="fv" runat="server">
                <ItemTemplate>
            <table align="center" bgcolor="white" BorderWidth="0" cellpadding="0" cellspacing="2">
                <tr>
                    <td align="right" bgcolor="#5A3E48">
                        <asp:Label ID="lblSapcode" runat="server" meta:resourcekey="lblSapcode"></asp:Label>
                    </td>
                    <td align="left" bgcolor="white">
                        <asp:Label CssClass="infor" SkinID="label" ID="lblSapcodeValue" Text='<%# Myobj.GetAreaCode() + Eval("Sapcode") %>' runat="server"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td align="right" bgcolor="#5A3E48">
                        <asp:Label ID="lblOldCode" runat="server" meta:resourcekey="lblOldCode"></asp:Label>
                    </td>
                    <td align="left" bgcolor="white">
                        <asp:HyperLink Font-Size="12px" ForeColor="Blue" ID="hlinkOldCodeValue" onclick="OpenLinkWindow();return false;" NavigateUrl="#"
                        runat="server"></asp:HyperLink>
                    </td>
                </tr>
                <tr>
                    <td align="right" bgcolor="#5A3E48">
                        <asp:Label ID="lblProdHierarchy" runat="server" meta:resourcekey="lblProdHierarchy"></asp:Label>
                    </td>
                    <td align="left" bgcolor="white">
                        <asp:Label CssClass="infor" SkinID="label" ID="lblProdHierarchyValue" Text='<%# Eval("ProdHierarchy") %>' runat="server"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td align="right" bgcolor="#5A3E48">
                        <asp:Label ID="lblDescription" runat="server" meta:resourcekey="lblDescription"></asp:Label>
                    </td>
                    <td align="left" bgcolor="white">
                        <asp:Label CssClass="infor" SkinID="label" ID="lblDescriptionValue" Text='<%# Eval("Description") %>' runat="server"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td align="right" bgcolor="#5A3E48">
                        <asp:Label ID="lblLocalDescription" runat="server" meta:resourcekey="lblLocalDescription"></asp:Label>
                    </td>
                    <td align="left" bgcolor="white">
                        <asp:Label CssClass="infor" SkinID="label" ID="Label2" Text='<%# Eval("LocalDescription") %>' runat="server"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td align="right" bgcolor="#5A3E48">
                        <asp:Label ID="lblMTD_S" runat="server"></asp:Label>
                    </td>
                    <td align="left" bgcolor="white">
                        <asp:Label CssClass="infor" SkinID="label" ID="lblMTDValue_S" runat="server" Text='<%# Eval("MTD_S") %>'></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td align="right" bgcolor="#5A3E48">
                        <asp:Label CssClass="infor" ID="lblMTD_PBOM" runat="server"></asp:Label>
                    </td>
                    <td align="left" bgcolor="white">
                        <asp:Label CssClass="infor" SkinID="label" ID="lblMTDValue_PBOM" runat="server" Text='<%# Eval("MTD_PBOM") %>'></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td align="right" bgcolor="#5A3E48">
                        <asp:Label ID="lblMTD_ALL" runat="server"></asp:Label>
                    </td>
                    <td align="left" bgcolor="white">
                        <asp:Label CssClass="infor" SkinID="label" ID="lblMTDValue_ALL" runat="server" Text='0'></asp:Label>
                    </td>
                </tr>       
                <tr>
                    <td align="right" bgcolor="#5A3E48">
                        <asp:Label ID="lblWHStock" runat="server" meta:resourcekey="lblWHStock"></asp:Label>
                    </td>
                    <td align="left" bgcolor="white">
                        <asp:Label CssClass="infor" SkinID="label" ID="lblWHStockValue" runat="server" Text='<%# Eval("WHStock") %>'></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td align="right" bgcolor="#5A3E48">
                        <asp:Label ID="lblBOMStock" runat="server" meta:resourcekey="lblBOMStock"></asp:Label>
                    </td>
                    <td align="left" bgcolor="white">
                        <asp:Label CssClass="infor" SkinID="label" ID="lblBOMStockValue" runat="server" Text='<%# Eval("BOMStock") %>'></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td align="right" bgcolor="#5A3E48">
                        <asp:Label ID="lblSubConStock" runat="server" meta:resourcekey="lblSubConStock"></asp:Label>
                    </td>
                    <td align="left" bgcolor="white">
                        <asp:Label CssClass="infor" SkinID="label" ID="lblSubConStockValue" runat="server" Text='<%# Eval("SubConStock") %>'></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td align="right" bgcolor="#5A3E48">
                        <asp:Label ID="lblInTransitStock" runat="server" meta:resourcekey="lblInTransitStock"></asp:Label>
                    </td>
                    <td align="left" bgcolor="white">
                        <asp:Label CssClass="infor" SkinID="label" ID="lblInTransitStockValue" runat="server" Text='<%# Eval("InTransitStock") %>'></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td align="right" bgcolor="#5A3E48">
                        <asp:Label ID="lblConsignmentStock" runat="server" meta:resourcekey="lblConsignmentStock"></asp:Label>
                    </td>
                    <td align="left" bgcolor="white">
                        <asp:Label CssClass="infor" SkinID="label" ID="lblConsignmentStockValue" runat="server" Text='<%# Eval("ConsignmentStock") %>'></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td align="right" bgcolor="#5A3E48">
                        <asp:Label ID="lblTotalStock" runat="server" meta:resourcekey="lblTotalStock"></asp:Label>
                    </td>
                    <td align="left" bgcolor="white">
                        <asp:Label CssClass="infor" SkinID="label" ID="lblTotalStockValue" runat="server" Text='<%# Eval("TotalStock") %>'></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td align="right" bgcolor="#5A3E48">
                        <asp:Label ID="lblStockCoverDays" runat="server" meta:resourcekey="lblStockCoverDays"></asp:Label>
                    </td>
                    <td align="left" bgcolor="white">
                        <asp:Label CssClass="infor" SkinID="label" ID="lblStockCoverDaysValue" runat="server" Text='0'></asp:Label>
                    </td>
                </tr>   
                <tr>
                    <td align="right" bgcolor="#5A3E48">
                        <asp:Label ID="lblTradeStockTotal" runat="server" meta:resourcekey="lblTradeStockTotal"></asp:Label>
                    </td>
                    <td align="left" bgcolor="white">
                        <asp:Label CssClass="infor" SkinID="label" ID="lblTradeStockTotalValue" runat="server" Text="0"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td align="right" bgcolor="#5A3E48">
                        <asp:Label ID="lblTradeStock_PBOM" runat="server" meta:resourcekey="lblTradeStock_PBOM"></asp:Label>
                    </td>
                    <td align="left" bgcolor="white">
                        <asp:Label CssClass="infor" SkinID="label" ID="lblTradeStock_PBOMValue" runat="server" Text='<%# Eval("TradeStock_PBOM") %>'></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td align="right" bgcolor="#5A3E48">
                        <asp:Label ID="lblTradeStock" runat="server" meta:resourcekey="lblTradeStock"></asp:Label>
                    </td>
                    <td align="left" bgcolor="white">
                        <asp:Label CssClass="infor" SkinID="label" ID="lblTradeStockValue" runat="server" Text='<%# Eval("TradeStock") %>'></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td align="left" colspan="2" bgcolor="lightyellow">
                        <asp:DataList ID="rptTradeStock" RepeatDirection="Horizontal" RepeatColumns="3" runat="server">
                            <HeaderTemplate>
                                <tr>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <td align="right">
                                        <table BorderWidth="1" cellpadding="2" cellspacing="2">
                                        <tr>
                                        <td align="right" bgcolor="lightyellow">
                                            <asp:Label CssClass="infor" SkinID="label" ID="lblCustomerGroupName" runat="server" Text='<%# Eval("ChannelName") %>'></asp:Label>
                                        </td>
                                        <td align="left" bgcolor="white">
                                            <asp:Label CssClass="infor" SkinID="label" ID="lblStock" runat="server" Text='<%# Eval("Stock") %>'></asp:Label>
                                        </td>   
                                        </tr>                         
                                        </table>
                                </td>
                            </ItemTemplate>
                            <FooterTemplate>
                                </tr>
                            </FooterTemplate>
                        </asp:DataList>
                    </td>
                </tr>
                
                <asp:Repeater ID="rptTradeStock1" runat="server">
                    <ItemTemplate>
                        <tr>
                            <td align="right" bgcolor="lightyellow">
                                <asp:Label CssClass="infor" SkinID="label" ID="lblCustomerGroupName" runat="server" Text='<%# Eval("ChannelName") %>'></asp:Label>
                            </td>
                            <td align="left" bgcolor="white">
                                <asp:Label CssClass="infor" SkinID="label" ID="lblStock" runat="server" Text='<%# Eval("Stock") %>'></asp:Label>
                            </td>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>
            </table>
                </ItemTemplate>
            </asp:FormView>    
            <asp:Button ID="btnCancel" OnClientClick="Javascript:window.close()" runat="server" meta:resourcekey="btnCancel"/>
    </div>
    <br/>
</asp:Content>
